﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Jumpton.SFA.Server.Entity;
using Jumpton.SFA.Server.BusinessRule.CallRoute;
using Jumpton.SFA.Server.BusinessRule;
using Jumpton.SFA.Server.BusinessRule.MasterData;
using Jumpton.Persistent;
using Jumpton.SFA.Entity;
using System.Configuration;

public partial class VisitBasicInfo :PageBase
{
    private decimal visitId;
    protected String photoInfo = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            visitId = decimal.Parse(Request.QueryString["visitid"]);
        }
        catch (Exception)
        {
            return;
        }
        //获取当前请求的查询字符串列表
        System.Collections.Specialized.NameValueCollection list = QueryStringHelper.DecodeQueryString(Request.QueryString);
        LoadImage();


    }


    private void LoadImage()
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        PhotoManager pm = new PhotoManager();
        ObjectTable ot = pm.LoadImagesByVisitID(visitId, "");
        String DetailContentFormat = "<li><img  src=\"{0}\"/></p></li>";

        for (int i = 0; i < ot.Count; i++)
        {
            PHOTO photo = (PHOTO)ot[i];
            String photoDate = Jumpton.SFA.Server.BusinessRule.BusinessLogic.GetDateTime(photo.PHOTODATE.ToString(), "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss");
            // String PhotoPath = String.Format(ServerPath+"UploadImages//{0}", photo.PHOTOPATH);
            String PhotoPath = ConfigurationManager.AppSettings["ServerPath"] + "IMAGE.aspx?" + photo.ID;
            sb.Append(String.Format(DetailContentFormat, PhotoPath, photoDate));
        }
        photoInfo = sb.ToString();
    }
}